import React, { useEffect } from 'react'
import { useTranslation, Trans } from 'react-i18next'
import i18next from 'i18next'
import GuoJiHua2 from './GuoJiHua2'
export default function () {
    // useEffect(() => {
    //     console.log(i18next.language);
    // }, [])

    const { t } = useTranslation()
    const changeLng = () => {
        console.log(i18next.language);
        if (i18next.language === 'en') {
            i18next.changeLanguage('zh')
            localStorage.setItem('localLNG', 'zh')
        } else {
            i18next.changeLanguage('en')
            localStorage.setItem('localLNG', 'en')
        }
    }
    return (
        <div onClick={changeLng}>
            <h2>国际化</h2>
            <p>{t(['todos.allOk'])}</p>
            <hr />
            <GuoJiHua2 />
        </div>
    )
}
